#!/bin/bash
OCH_VERSION=9.0.2
OCH=OCHamcrest-${OCH_VERSION}
OCH_ZIP=${OCH}.zip

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
pushd "$DIR"

curl -L https://github.com/hamcrest/OCHamcrest/releases/download/v${OCH_VERSION}/${OCH_ZIP} > ${OCH_ZIP}
OUT=$?
if [ "${OUT}" -ne "0" ]; then
    echo OCHamcrest download failed
    exit ${OUT}
fi

rm -rf ${OCH}
unzip ${OCH_ZIP}
rm ${OCH_ZIP}

mkdir -p ../Carthage/Build/
mv ${OCH}/OCHamcrest.xcframework ../Carthage/Build

popd
